//
//  BCOrderConDetailCell.m
//  BangcaiBuy
//
//  Created by lsy on 16/7/4.
//  Copyright © 2016年 BCB. All rights reserved.
//

#import "BCOrderConDetailCell.h"

@interface BCOrderConDetailCell ()
{
    UILabel *headLab1;
    UILabel *headLab2;
    UILabel *headLab3;
    UILabel *headLab4;
    UILabel *headLab5;

}

@end

@implementation BCOrderConDetailCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView
{
    headLab1 = [[UILabel alloc] init];
    headLab2 = [[UILabel alloc] init];
    headLab3 = [[UILabel alloc] init];
    headLab4 = [[UILabel alloc] init];
    headLab5 = [[UILabel alloc] init];
    
    headLab1.font = [UIFont systemFontOfSize:13];
    headLab1.textColor = [UIColor colorWithRed:0.486  green:0.486  blue:0.486 alpha:1];
    headLab1.textAlignment = NSTextAlignmentCenter;
  
    headLab2.font = [UIFont systemFontOfSize:13];
    headLab2.textColor = [UIColor colorWithRed:0.486  green:0.486  blue:0.486 alpha:1];
    headLab2.textAlignment = NSTextAlignmentLeft;

    headLab3.font = [UIFont systemFontOfSize:13];
    headLab3.textColor = [UIColor colorWithRed:0.486  green:0.486  blue:0.486 alpha:1];
    headLab3.textAlignment = NSTextAlignmentLeft;
       headLab4.font = [UIFont systemFontOfSize:13];
    headLab4.textColor = [UIColor colorWithRed:0.486  green:0.486  blue:0.486 alpha:1];
    headLab4.textAlignment = NSTextAlignmentLeft;
      headLab5.font = [UIFont systemFontOfSize:13];
    headLab5.textColor = [UIColor colorWithRed:0.486  green:0.486  blue:0.486 alpha:1];
    headLab5.textAlignment = NSTextAlignmentLeft;
    
    
    [self.contentView addSubview:headLab1];
    [self.contentView addSubview:headLab2];
    [self.contentView addSubview:headLab3];
    [self.contentView addSubview:headLab4];
    [self.contentView addSubview:headLab5];


}

- (void)layoutSubviews
{
    headLab1.text = [NSString stringWithFormat:@"%@", self.category];
    headLab2.text = [NSString stringWithFormat:@"%@", self.name];
    headLab3.text =[NSString stringWithFormat:@"%@", self.unit];
    headLab4.text = [NSString stringWithFormat:@"%@", self.amount];
    headLab5.text = [NSString stringWithFormat:@"%.2f", self.price.floatValue];

    [headLab1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(24 *wx);
        make.height.mas_equalTo(20);
        make.centerY.mas_equalTo(0);
        make.width.mas_equalTo(60 *wx);
    }];
    [headLab2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(headLab1.mas_right).mas_equalTo(10*wx);
        make.height.mas_equalTo(20);
        make.centerY.mas_equalTo(0);
        make.width.mas_equalTo(80 *wx);
    }];
    [headLab3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(headLab2.mas_right).mas_equalTo(20*wx);
        make.height.mas_equalTo(20);
        make.centerY.mas_equalTo(0);
         make.width.mas_equalTo(50 *wx);
    }];
    [headLab4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(headLab3.mas_right).mas_equalTo(30*wx);
        make.height.mas_equalTo(20);
        make.centerY.mas_equalTo(0);
         make.width.mas_equalTo(50 *wx);
    }];
    [headLab5 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(headLab4.mas_right).mas_equalTo(20 *wx);
        make.height.mas_equalTo(20);
        make.centerY.mas_equalTo(0);
         make.width.mas_equalTo(50 *wx);
    }];

}

@end
